#include "Record.h"

Record::Record(Record&& t) : len (t.len) , data(t.data)
{
    t.data = 0 ;
    t.len = 0 ;
}

Record::Record(unsigned len, const char* const ptr) : len(len)
{
    if (ptr)
    {
        data = static_cast<char*>(malloc(len)) ;
        memcpy(data, ptr, len);
    }
    else
    {
        data = NULL;
    }
}

const char* Record::getData() const
{
    return data;
}

unsigned Record::getLen() const
{
    return len;
}
Record::~Record()
{
    free(data);
}

